from django.db import models


# Create your models here.
class Student(models.Model):
    # 1. 字段[数据库表字段对应]
    SEX_CHOICES = (
        (0, "女"),
        (1, "男"),
        (2, "保密"),
    )
    name = models.CharField(max_length=32,verbose_name="姓名")
    age = models.IntegerField(verbose_name="年龄")
    gender = models.SmallIntegerField(verbose_name="性别", choices=SEX_CHOICES)
    birthday = models.DateField(verbose_name="生日")
    description = models.TextField(verbose_name="描述",default="")

    class Meta:
        db_table = "student"  # 2. 元数据[数据库表名]

    def __str__(self):
        return self.name + " " + str(self.age)